const express = require("express")
const messageRouter = express.Router()

const messageSevr = require("../../services/messageServices")

messageRouter.get("/addMessage", async(req,res,next)=>{
    try {
        const result = await messageSevr.addMessage(req.query)
        if(result){
            res.send(result)
        }
    } catch (error) {
        next(error)
    }
})

messageRouter.get("/getYhly", async(req,res,next)=>{
    try {
        const result = await messageSevr.getYhly()
        if(result){
            res.send(result)
        }
    } catch (error) {
        next(error)
    }
})

module.exports = messageRouter